package com.jp.juc.atomic;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * 基本类型的原子操作类
 */
public class UseAtomicInt {
    public static final AtomicInteger ATOMIC_INTEGER = new AtomicInteger();
    public static void main(String[] args) {
        System.out.println(ATOMIC_INTEGER.getAndIncrement());
        System.out.println(ATOMIC_INTEGER.incrementAndGet());
        System.out.println(ATOMIC_INTEGER.addAndGet(24));
        System.out.println(ATOMIC_INTEGER.get());
    }
}
